<?php

use Phalcon\Mvc\Router;

$router = new Router(false);
$router->removeExtraSlashes(true);

$router->add(
    "/",
    [
        'controller' => "index",
        'action'     => "index",
    ]
);

$router->add(
    '/:controller',
    [
        'controller' => 1,
        'action' => 'index'
    ]
);

$router->add(
    '/:controller/:action',
    [
        'controller' => 1,
        'action' => 2
    ]
);

$router->add(
    '/:controller/:action/:int',
    [
        'controller' => 1,
        'action' => 2,
        'id' => 3,
    ]
);

$router->add(
    "/admin",
    [
		'namespace'  => "App\\Http\\ControllersAdmin",
        'controller' => "index",
        'action'     => "index",
    ]
);

$router->add(
    '/admin/:controller',
    [
	    'namespace'  => "App\\Http\\ControllersAdmin",
        'controller' => 1,
        'action' => 'index',
    ]
);

$router->add(
    '/admin/:controller/:action',
    [
	    'namespace'  => "App\\Http\\ControllersAdmin",
        'controller' => 1,
        'action' => 2
    ]
);

$router->add(
    '/admin/:controller/:action/:int',
    [
	    'namespace'  => "App\\Http\\ControllersAdmin",
        'controller' => 1,
        'action' => 2,
        'id' => 3,
    ]
);

return $router;
